import request from '@/utils/request'
let serviceName = window.ipConfigUrl.carService
    //品牌管理页面
    /**
     * 新增品牌信息
     * @param {*} data
     * @returns
     */
export function addCarLetter(data) {
    return request({
        url: serviceName + '/carLetters/add',
        method: 'post',
        data
    })
}

/**
 * 删除品牌信息
 * @param {*} data
 * @returns
 */
export function delCarLetter(data) {
    return request({
        url: serviceName + '/carLetters/del',
        method: 'post',
        data
    })
}

/**
 * 修改品牌信息
 * @param {*} data
 * @returns
 */
export const upCarLetter = data => {
    return request({
        url: serviceName + '/carLetters/update',
        method: 'post',
        data
    })
}

/**
 * 获取品牌信息
 * @param {*} data
 * @returns
 */
export function getCarLetterList(data) {
    return request({
        url: serviceName + '/carLetters/page',
        method: 'post',
        data
    })
}

//车系管理页面
/**
 * 新增车系信息
 * @param {*} data
 * @returns
 */
export const addCarBrand = data => {
    return request({
        url: serviceName + '/carBrand/add',
        method: 'post',
        data
    })
}

/**
 * 删除车系信息
 * @param {*} data
 * @returns
 */
export const delCarBrand = data => {
    return request({
        url: serviceName + '/carBrand/del',
        method: 'post',
        data
    })
}

/**
 * 修改车系信息
 * @param {*} data
 * @returns
 */
export const upCarBrand = data => {
    return request({
        url: serviceName + '/carBrand/update',
        method: 'post',
        data
    })
}

/**
 * 获取车系信息
 * @param {*} data
 * @returns
 */
export const getCarBrandList = data => {
        return request({
            url: serviceName + '/carBrand/page',
            method: 'post',
            data
        })
    }
    /**
     * 获取车系信息
     * @param {*} data
     * @returns
     */
export const getCarTreeBrandList = data => {
    return request({
        url: serviceName + '/carBrand/tree',
        method: 'post',
        data
    })
}


//车型管理页面
/**
 * 新增车型信息
 * @param {*} data
 * @returns
 */
export const addCar = data => {
    return request({
        url: serviceName + '/carCar/add',
        method: 'post',
        data
    })
}

/**
 * 删除车型信息
 * @param {*} data
 * @returns
 */
export const delCar = data => {
    return request({
        url: serviceName + '/carCar/del',
        method: 'post',
        data
    })
}

/**
 * 修改车型信息
 * @param {*} data
 * @returns
 */
export const upCar = data => {
    return request({
        url: serviceName + '/carCar/update',
        method: 'post',
        data
    })
}

/**
 * 获取车型信息
 * @param {*} data
 * @returns
 */
export const getCarList = data => {
    return request({
        url: serviceName + '/carCar/page',
        method: 'post',
        data
    })
}

//车架号管理页面
/**
 * 新增车架号信息
 * @param {*} data
 * @returns
 */
export const addCarVin = data => {
    return request({
        url: serviceName + '/carVin/add',
        method: 'post',
        data
    })
}

/**
 * 删除车架号信息
 * @param {*} data
 * @returns
 */
export const delCarVin = data => {
    return request({
        url: serviceName + '/carVin/del',
        method: 'post',
        data
    })
}

/**
 * 修改车架号信息
 * @param {*} data
 * @returns
 */
export const upCarVin = data => {
    return request({
        url: serviceName + '/carVin/update',
        method: 'post',
        data
    })
}

/**
 * 获取车架号信息
 * @param {*} data
 * @returns
 */
export const getCarVinList = data => {
    return request({
        url: serviceName + '/carVin/page',
        method: 'post',
        data
    })
}

/**
 * 车架号识别信息
 * @param {*} data
 * @returns
 */
export const getCarByVin = data => {
    return request({
        url: serviceName + '/carVin/vinSimList',
        method: 'get',
        params: data
    })
}

/**
 * 车架号图片识别信息
 * @param {*} data
 * @returns
 */
export const getCarVinByImg = data => {
    return request({
        url: serviceName + '/carVin/vinImg',
        method: 'post',
        data
    })
}


//配件分类管理页面
/**
 * 新增配件分类信息
 * @param {*} data
 * @returns
 */
export const addCarClassify = data => {
    return request({
        url: serviceName + '/carClassify/add',
        method: 'post',
        data
    })
}

/**
 * 删除配件分类信息
 * @param {*} data
 * @returns
 */
export const delCarClassify = data => {
    return request({
        url: serviceName + '/carClassify/del',
        method: 'post',
        data
    })
}

/**
 * 修改配件分类信息
 * @param {*} data
 * @returns
 */
export const upCarClassify = data => {
    return request({
        url: serviceName + '/carClassify/update',
        method: 'post',
        data
    })
}

/**
 * 获取配件分类信息
 * @param {*} data
 * @returns
 */
export const getCarClassifyList = data => {
    return request({
        url: serviceName + '/carClassify/page',
        method: 'post',
        data
    })
}

/**
 * 获取配件分类树形信息
 * @param {*} data
 * @returns
 */
export const getCarClassifyTreeList = data => {
    return request({
        url: serviceName + '/carClassify/tree',
        method: 'get',
        params: data
    })
}


//区域管理页面
/**
 * 新增区域信息
 * @param {*} data
 * @returns
 */
export const addSysRegion = data => {
    return request({
        url: serviceName + '/sysRegion/add',
        method: 'post',
        data
    })
}

/**
 * 删除区域信息
 * @param {*} data
 * @returns
 */
export const delSysRegion = data => {
    return request({
        url: serviceName + '/sysRegion/del',
        method: 'post',
        data
    })
}

/**
 * 修改区域信息
 * @param {*} data
 * @returns
 */
export const upSysRegion = data => {
    return request({
        url: serviceName + '/sysRegion/update',
        method: 'post',
        data
    })
}

/**
 * 获取区域信息
 * @param {*} data
 * @returns
 */
export const getSysRegionList = data => {
    return request({
        url: serviceName + '/sysRegion/page',
        method: 'post',
        data
    })
}

//供应商管理页面-爬数据
/**
 * 新增供应商信息
 * @param {*} data
 * @returns
 */
export const addCarMafrer = data => {
    return request({
        url: serviceName + '/carManufacturer/add',
        method: 'post',
        data
    })
}

/**
 * 删除供应商信息
 * @param {*} data
 * @returns
 */
export const delCarMafrer = data => {
    return request({
        url: serviceName + '/carManufacturer/del',
        method: 'post',
        data
    })
}

/**
 * 修改供应商信息
 * @param {*} data
 * @returns
 */
export const upCarMafrer = data => {
    return request({
        url: serviceName + '/carManufacturer/update',
        method: 'post',
        data
    })
}

/**
 * 获取供应商信息
 * @param {*} data
 * @returns
 */
export const getCarMafrerList = data => {
    return request({
        url: serviceName + '/carManufacturer/page',
        method: 'post',
        data
    })
}

//配件管理页面
/**
 * 新增配件信息
 * @param {*} data
 * @returns
 */
export const addMaterial = data => {
    return request({
        url: serviceName + '/jshMaterial/add',
        method: 'post',
        data
    })
}

/**
 * 删除配件信息
 * @param {*} data
 * @returns
 */
export const delMaterial = data => {
    return request({
        url: serviceName + '/jshMaterial/del',
        method: 'post',
        data
    })
}

/**
 * 修改配件信息
 * @param {*} data
 * @returns
 */
export const upMaterial = data => {
    return request({
        url: serviceName + '/jshMaterial/update',
        method: 'post',
        data
    })
}

/**
 * 获取配件信息
 * @param {*} data
 * @returns
 */
export const getMaterialList = data => {
    return request({
        url: serviceName + '/jshMaterial/page',
        method: 'post',
        data
    })
}

/**
 * 获取单个配件详情信息
 * @param {*} data
 * @returns
 */
export const getMaterialById = data => {
    return request({
        url: serviceName + '/jshMaterial/info',
        method: 'get',
        params: data
    })
}

/**
 * 上传配件图片
 * @param {*} data
 * @returns
 */
export const uploadFile = data => {
    return request({
        url: serviceName + '/xyzImgfile/upload',
        method: 'post',
        data
    })
}

//经销商管理页面
/**
 * 新增经销商信息
 * @param {*} data
 * @returns
 */
export const addJshSupplierJXS = data => {
    return request({
        url: serviceName + '/jshSupplier/addJXS',
        method: 'post',
        data
    })
}

/**
 * 删除经销商/供应商信息
 * @param {*} data
 * @returns
 */
export const delJshSupplier = data => {
    return request({
        url: serviceName + '/jshSupplier/del',
        method: 'post',
        data
    })
}

/**
 * 修改经销商信息
 * @param {*} data
 * @returns
 */
export const upJshSupplierJXS = data => {
    return request({
        url: serviceName + '/jshSupplier/updateJXS',
        method: 'post',
        data
    })
}

/**
 * 获取经销商信息
 * @param {*} data
 * @returns
 */
export const getJshSupplierJXSList = data => {
    return request({
        url: serviceName + '/jshSupplier/pageJXS',
        method: 'post',
        data
    })
}

/**
 * 根据供应商获取配件信息
 * @param {*} data
 * @returns
 */
export const getMarListBySupId = data => {
        return request({
            url: serviceName + '/shgSupplierCity/pageCtSl',
            method: 'post',
            data
        })
    }
    //数据管理
    //品牌管理页面
    /**
     * 新增品牌信息
     * @param {*} data
     * @returns
     */
export function addCarjLetter(data) {
    return request({
        url: serviceName + '/carjLetters/add',
        method: 'post',
        data
    })
}

/**
 * 删除品牌信息
 * @param {*} data
 * @returns
 */
export function delCarjLetter(data) {
    return request({
        url: serviceName + '/carjLetters/del',
        method: 'post',
        data
    })
}

/**
 * 修改品牌信息
 * @param {*} data
 * @returns
 */
export const upCarjLetter = data => {
    return request({
        url: serviceName + '/carjLetters/update',
        method: 'post',
        data
    })
}

/**
 * 获取品牌信息
 * @param {*} data
 * @returns
 */
export function getCarjLetterList(data) {
    return request({
        url: serviceName + '/carjLetters/page',
        method: 'post',
        data
    })
}

//车系管理页面
/**
 * 新增车系信息
 * @param {*} data
 * @returns
 */
export const addCarjBrand = data => {
    return request({
        url: serviceName + '/carjBrand/add',
        method: 'post',
        data
    })
}

/**
 * 删除车系信息
 * @param {*} data
 * @returns
 */
export const delCarjBrand = data => {
    return request({
        url: serviceName + '/carjBrand/del',
        method: 'post',
        data
    })
}

/**
 * 修改车系信息
 * @param {*} data
 * @returns
 */
export const upCarjBrand = data => {
    return request({
        url: serviceName + '/carjBrand/update',
        method: 'post',
        data
    })
}

/**
 * 获取车系信息
 * @param {*} data
 * @returns
 */
export const getCarjBrandList = data => {
    return request({
        url: serviceName + '/carjBrand/page',
        method: 'post',
        data
    })
}


//车型管理页面
/**
 * 新增车型信息
 * @param {*} data
 * @returns
 */
export const addCarj = data => {
    return request({
        url: serviceName + '/carjCar/add',
        method: 'post',
        data
    })
}

/**
 * 删除车型信息
 * @param {*} data
 * @returns
 */
export const delCarj = data => {
    return request({
        url: serviceName + '/carjCar/del',
        method: 'post',
        data
    })
}

/**
 * 修改车型信息
 * @param {*} data
 * @returns
 */
export const upCarj = data => {
    return request({
        url: serviceName + '/carjCar/update',
        method: 'post',
        data
    })
}

/**
 * 获取车型信息
 * @param {*} data
 * @returns
 */
export const getCarjList = data => {
    return request({
        url: serviceName + '/carjCar/page',
        method: 'post',
        data
    })
}

//汽配网数据
/**
 * 新增配件信息
 * @param {*} data
 * @returns
 */
export const addCarpart = data => {
    return request({
        url: serviceName + '/carPart/add',
        method: 'post',
        data
    })
}

/**
 * 删除配件信息
 * @param {*} data
 * @returns
 */
export const delCarpart = data => {
    return request({
        url: serviceName + '/carPart/del',
        method: 'post',
        data
    })
}

/**
 * 修改配件信息
 * @param {*} data
 * @returns
 */
export const upCarpart = data => {
    return request({
        url: serviceName + '/carPart/update',
        method: 'post',
        data
    })
}

/**
 * 获取配件信息
 * @param {*} data
 * @returns
 */
export const getCarpartList = data => {
    return request({
        url: serviceName + '/carPart/page',
        method: 'post',
        data
    })
}